package com.isias.system.handler;

import com.isias.common.result.ResultCodeEnum;
import lombok.Data;


@Data
public class LoginException extends RuntimeException{

    private Integer code;
    private String msg;

    public LoginException(){}
    public LoginException(String message, Integer code, String msg) {
        super(message);
        this.code = code;
        this.msg = msg;
    }

    public LoginException(ResultCodeEnum resultCodeEnum){
        super(resultCodeEnum.getMessage());
        this.code=resultCodeEnum.getCode();
        this.msg=resultCodeEnum.getMessage();
    }

    @Override
    public String toString() {
        return "LoginException{" +
                "code=" + code +
                ", msg='" + this.getMsg() + '\'' +
                '}';
    }
}
